<?php
	require "db_connection.php";
	$q=mysql_query("SELECT
					drivers.driversname,
					drivers.contactno,
					affiliate.companyname,
					affiliate.websiteurl,
					affiliate.landline,
					drivers.driverid
					FROM
					drivers
					INNER JOIN affiliate ON affiliate.affiliateid = drivers.affiliateid ORDER BY drivers.driversname");	
	
	$acc_num = 0;
	$class_alternate = "";
	while($row = mysql_fetch_array($q)){
		$acc_num=$acc_num+1;
		echo"<tr class='". $class_alternate ."'>
						<td>".$acc_num."</td>
						<td><b>" .$row['driversname']. "</b></td>
						<td>" .$row['contactno']. "</td>
						<td><b>" .$row['companyname']. "</b></td>
						<td><a href='" .$row['websiteurl']. "'>" .$row['websiteurl']. "</a></td>
						<td>" .$row['landline']. "</td>
						<td class='options-width'>
						<a href='' title='Edit' class='icon-1 info-tooltip'></a>
						<a href='' title='Delete' class='icon-2 info-tooltip'></a>
						<a href='view_driver.php?id=" . $row['driverid'] . "' title='View' class='icon-5 info-tooltip'></a>
						</td>
					</tr> ";
		if($class_alternate==""){ $class_alternate="alternate-row";}
		else{$class_alternate="";}				
	}
?>
